<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>emp-toolkit: /Users/wangxiao/git/emp-toolkit/emp-tool/circuits/float.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo-full-doxygen.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">emp-toolkit
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('float_8hpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">float.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="float_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"><a class="line" href="class_float.html#afbd828b6a445e1cf8a44bee1441deeea">    1</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_float.html#a1383145c75dd0c9f67a708c7f6df05c3">Float::Float</a>(<span class="keywordtype">int</span> value_length, <span class="keywordtype">int</span> expnt_length, <span class="keywordtype">double</span> input, <span class="keywordtype">int</span> <a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>) {</div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;   <span class="keywordtype">double</span> <a class="code" href="class_float.html#a983db0d2b83de7893840b434c9f52e67">abs</a> = input &gt; 0 ? input:-1*input;</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;   <span class="keywordtype">double</span> lo = pow(2, value_length-2);</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;   <span class="keywordtype">double</span> up = pow(2, value_length-1);</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;   <span class="keywordtype">int</span> p = 0;</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;   <span class="keywordflow">while</span>(abs &lt; lo) {abs*=2;--p;}</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;   <span class="keywordflow">while</span>(abs &gt;= up) {abs/=2;++p;}</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;   <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = <a class="code" href="class_integer.html">Integer</a>(expnt_length, p, party);</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;   <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = <a class="code" href="class_integer.html">Integer</a>(value_length, (<span class="keywordtype">long</span> <span class="keywordtype">long</span>)(abs*(input &gt; 0 ? 1: -1)), party);</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;}</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="class_float.html#aefd2dcc4f6de7cff5b947a204f4e65f8">   12</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_float.html">Float</a> <a class="code" href="class_float.html#aefd2dcc4f6de7cff5b947a204f4e65f8">Float::If</a>(<span class="keyword">const</span> <a class="code" href="class_bit.html">Bit</a> &amp; select, <span class="keyword">const</span> <a class="code" href="class_float.html">Float</a>&amp; d) {</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;    <a class="code" href="class_float.html">Float</a> res(*<span class="keyword">this</span>);</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;   res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_swappable.html#ac97b7bae2309410714c7416f1de53378">If</a>(select, d.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>);</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;   res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>.<a class="code" href="class_swappable.html#ac97b7bae2309410714c7416f1de53378">If</a>(select, d.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>);</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;   <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;}</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keyword">template</span>&lt;&gt;</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="class_float.html#a5b8dc67029c1bafac04c113d90b7ed8d">   20</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">string</span> Float::reveal&lt;string&gt;(<span class="keywordtype">int</span> <a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>) <span class="keyword">const</span> {</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;   <span class="keywordtype">double</span> val = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#a46c3a539863fb2ff610a4d6ef61b9367">reveal</a>&lt;<span class="keywordtype">long</span> <span class="keywordtype">long</span>&gt;(<a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>);</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;   <span class="keywordtype">double</span> exp = <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>.<a class="code" href="class_integer.html#a46c3a539863fb2ff610a4d6ef61b9367">reveal</a>&lt;<span class="keywordtype">long</span> <span class="keywordtype">long</span>&gt;(<a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>);</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;   <span class="keywordflow">return</span> to_string(val*pow(2.0, exp)); </div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;}</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="keyword">template</span>&lt;&gt;</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="class_float.html#ac8a3c771696656e218d345a4660cff62">   27</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">double</span> Float::reveal&lt;double&gt;(<span class="keywordtype">int</span> <a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>) <span class="keyword">const</span> {</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;   <span class="keywordtype">double</span> val = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#a46c3a539863fb2ff610a4d6ef61b9367">reveal</a>&lt;<span class="keywordtype">long</span> <span class="keywordtype">long</span>&gt;(<a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>);</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;   <span class="keywordtype">double</span> exp = <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>.<a class="code" href="class_integer.html#a46c3a539863fb2ff610a4d6ef61b9367">reveal</a>&lt;<span class="keywordtype">long</span> <span class="keywordtype">long</span>&gt;(<a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>);</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;   <span class="keywordflow">return</span> val*pow(2.0, exp); </div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;}</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="class_float.html#acf4a690bafac44c1d308ca10fd11b0be">   33</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">string</span> <a class="code" href="class_float.html#acf4a690bafac44c1d308ca10fd11b0be">Float::detail</a>(<span class="keywordtype">int</span> <a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;   <span class="keywordtype">string</span> res = reveal&lt;string&gt;(<a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>);</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;   res += (<span class="stringliteral">&quot; v: &quot;</span> + <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#a46c3a539863fb2ff610a4d6ef61b9367">reveal</a>&lt;<span class="keywordtype">string</span>&gt;(<a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>));</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;   res += (<span class="stringliteral">&quot; p: &quot;</span> + <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>.<a class="code" href="class_integer.html#a46c3a539863fb2ff610a4d6ef61b9367">reveal</a>&lt;<span class="keywordtype">string</span>&gt;(<a class="code" href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a>));</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;   <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;}</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="class_float.html#ab97c9072b1b955697049e020c238a445">   40</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="class_float.html#ab97c9072b1b955697049e020c238a445">Float::size</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;   <span class="keywordflow">return</span> <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()+<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>();</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;}</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="class_float.html#a983db0d2b83de7893840b434c9f52e67">   44</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_float.html">Float</a> <a class="code" href="class_float.html#a983db0d2b83de7893840b434c9f52e67">Float::abs</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;   <a class="code" href="class_float.html">Float</a> res(*<span class="keyword">this</span>);</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;   res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#ac6bdcb2c326485873b4797ae3b4aea80">abs</a>();</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;   <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;}</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="class_float.html#aa879567bee82ec6f3845b93df1791569">   50</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_float.html#aa879567bee82ec6f3845b93df1791569">Float::normalize</a>(<span class="keywordtype">int</span> value_length, <span class="keywordtype">int</span> to_add_to_expnt) {</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;   <a class="code" href="class_integer.html">Integer</a> value_before_normalize = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;   <a class="code" href="class_integer.html">Integer</a> bits_to_shift(value_before_normalize.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>(), 0, <a class="code" href="utils_8h.html#ad17d551e31d1828c68acf40684849b7e">PUBLIC</a>);</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;   <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = bits_to_shift.size()-1; i&gt;0; --i)</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;      bits_to_shift[i] = value_before_normalize[i] ^ value_before_normalize[i-1];</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;   bits_to_shift[0] = <span class="keyword">true</span>;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;   <a class="code" href="class_integer.html">Integer</a> shift_amount = bits_to_shift.<a class="code" href="class_integer.html#a40379b494d4d66d0cbeddc0d72310edc">leading_zeros</a>();</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;   value_before_normalize = value_before_normalize &lt;&lt; shift_amount;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;   <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> - shift_amount;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = value_before_normalize;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> &gt;&gt; (value_before_normalize.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>() - value_length);</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#a4f3c2fa68e1a235b05a42b337fcd301f">resize</a>(value_length);</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;   <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> + <a class="code" href="class_integer.html">Integer</a>(<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>(), (value_before_normalize.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>() + to_add_to_expnt - value_length), <a class="code" href="utils_8h.html#ad17d551e31d1828c68acf40684849b7e">PUBLIC</a>);</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;}</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="class_float.html#afa32b241f39b9caf3cc574f49b00259e">   67</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_float.html">Float</a> <a class="code" href="class_float.html#afa32b241f39b9caf3cc574f49b00259e">Float::operator+</a>(<span class="keyword">const</span> <a class="code" href="class_float.html">Float</a>&amp; rhs)<span class="keyword"> const</span>{</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <a class="code" href="class_float.html">Float</a> res(*<span class="keyword">this</span>);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;   <a class="code" href="class_integer.html">Integer</a> diff = <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> - rhs.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;   <a class="code" href="class_integer.html">Integer</a> diff_abs = diff.<a class="code" href="class_integer.html#ac6bdcb2c326485873b4797ae3b4aea80">abs</a>();</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;   <a class="code" href="class_bit.html">Bit</a> to_swap = diff[diff.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()-1];</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;   res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>.<a class="code" href="class_swappable.html#ac97b7bae2309410714c7416f1de53378">If</a>(!to_swap, rhs.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>);</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;   <a class="code" href="class_integer.html">Integer</a> v1 = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>, v2 = rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;   <a class="code" href="swappable_8h.html#a4043c520b57fcca7b1eaa03102828a0a">swap</a>(to_swap, v1, v2);</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;   v1.<a class="code" href="class_integer.html#a4f3c2fa68e1a235b05a42b337fcd301f">resize</a>(2*<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>(), <span class="keyword">true</span>);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;   v1 = v1 &lt;&lt; diff_abs;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;   v2.<a class="code" href="class_integer.html#a4f3c2fa68e1a235b05a42b337fcd301f">resize</a>(2*<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>(), <span class="keyword">true</span>);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;   res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = v1 + v2;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;   res.<a class="code" href="class_float.html#aa879567bee82ec6f3845b93df1791569">normalize</a>(rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>(), 0);</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;   <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;}</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="class_float.html#a60373cd204e754bf2c9d769f72f03c53">   85</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_float.html">Float</a> <a class="code" href="class_float.html#aa39a93665ab0b36f29553229fd544e8b">Float::operator-</a>(<span class="keyword">const</span> <a class="code" href="class_float.html">Float</a>&amp; rhs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keywordflow">return</span> (*<span class="keyword">this</span>) + (-rhs);</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;}</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="class_float.html#aa39a93665ab0b36f29553229fd544e8b">   89</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_float.html">Float</a> <a class="code" href="class_float.html#aa39a93665ab0b36f29553229fd544e8b">Float::operator-</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;   <a class="code" href="class_float.html">Float</a> res = *<span class="keyword">this</span>;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;   res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = -res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;   <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;}</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="class_float.html#ac8a4119a7439bb5035fb702b203f77f2">   95</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_float.html">Float</a> <a class="code" href="class_float.html#ac8a4119a7439bb5035fb702b203f77f2">Float::operator*</a>(<span class="keyword">const</span> <a class="code" href="class_float.html">Float</a>&amp; rhs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <a class="code" href="class_float.html">Float</a> res(*<span class="keyword">this</span>);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <a class="code" href="class_integer.html">Integer</a> v1 = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <a class="code" href="class_integer.html">Integer</a> v2 = rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    v1.<a class="code" href="class_integer.html#a4f3c2fa68e1a235b05a42b337fcd301f">resize</a>(<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()*2);</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    v2.<a class="code" href="class_integer.html#a4f3c2fa68e1a235b05a42b337fcd301f">resize</a>(<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()*2);</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    v1 = v1*v2;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;   <a class="code" href="class_bit.html">Bit</a> extra_move = v1[v1.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()-1] == v1[v1.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()-2];</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;   v1 = v1.<a class="code" href="class_swappable.html#ac97b7bae2309410714c7416f1de53378">If</a>(extra_move, v1 &lt;&lt; 1);</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = v1 &gt;&gt; (v1.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>() - rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>());</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#a4f3c2fa68e1a235b05a42b337fcd301f">resize</a>(rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>());</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;   res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> + rhs.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;   res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>.<a class="code" href="class_swappable.html#ac97b7bae2309410714c7416f1de53378">If</a>(extra_move, res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> - <a class="code" href="class_integer.html">Integer</a>(res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>(), 1));</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;   res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> +  <a class="code" href="class_integer.html">Integer</a>(res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>(), (v1.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()-rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()), <a class="code" href="utils_8h.html#ad17d551e31d1828c68acf40684849b7e">PUBLIC</a>);</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;   <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;}</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="float_8hpp.html#ac876e387f6e33f7446a0bc1ea7eb3550">  114</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_integer.html">Integer</a> <a class="code" href="float_8hpp.html#ac876e387f6e33f7446a0bc1ea7eb3550">divide_frac</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a>&amp; lhs, <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a>&amp; rhs) {</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;   <a class="code" href="class_integer.html">Integer</a> i1 = lhs, i2 = rhs;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;   i1.<a class="code" href="class_integer.html#a4f3c2fa68e1a235b05a42b337fcd301f">resize</a>(rhs.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()*2+1, <span class="keyword">false</span>);</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;   i1=i1&lt;&lt;rhs.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>();</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;   <a class="code" href="class_integer.html">Integer</a> res(2*rhs.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>(), 0, 0);</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;   <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt;= rhs.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>(); ++i) {</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <a class="code" href="class_integer.html">Integer</a> tmp = i1 &gt;&gt; (rhs.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()-i);</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        tmp.<a class="code" href="class_integer.html#a4f3c2fa68e1a235b05a42b337fcd301f">resize</a>(i1.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>() - rhs.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>());</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;      <a class="code" href="class_integer.html">Integer</a> diff = tmp - i2;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;      res[rhs.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()-i] = !diff[diff.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()-1];</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;      tmp = tmp.<a class="code" href="class_swappable.html#ac97b7bae2309410714c7416f1de53378">If</a>(!diff[diff.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()-1], diff);</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;      <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j = 0; j &lt; tmp.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>(); ++j)</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;         i1[rhs.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()+j-i] = tmp[j];</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;   }</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;   <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;}</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="comment">//to optimize</span></div><div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="class_float.html#a960edb0060fc2ca0b4a2aee99b005863">  133</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_float.html">Float</a> <a class="code" href="class_float.html#a960edb0060fc2ca0b4a2aee99b005863">Float::operator/</a>(<span class="keyword">const</span> <a class="code" href="class_float.html">Float</a>&amp; rhs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <a class="code" href="class_float.html">Float</a> res(*<span class="keyword">this</span>);</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;   <a class="code" href="class_bit.html">Bit</a> sign = rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>[rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()-1] != <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>[<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()-1];</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;   <a class="code" href="class_integer.html">Integer</a> v_tmp = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#ac6bdcb2c326485873b4797ae3b4aea80">abs</a>();</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;   <a class="code" href="class_integer.html">Integer</a> rhs_v_tmp = rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#ac6bdcb2c326485873b4797ae3b4aea80">abs</a>();</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;   res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = <a class="code" href="float_8hpp.html#ac876e387f6e33f7446a0bc1ea7eb3550">divide_frac</a>(v_tmp, rhs_v_tmp);</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;   res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_swappable.html#ac97b7bae2309410714c7416f1de53378">If</a>(sign, -<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>);</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;   res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> - rhs.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;   res.<a class="code" href="class_float.html#aa879567bee82ec6f3845b93df1791569">normalize</a>(rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>(), -1*rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>());</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;   <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;}</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="class_float.html#a2828cf2dfd7d5f814ff6e8ef75327ac0">  145</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_float.html">Float</a> <a class="code" href="class_float.html#a2828cf2dfd7d5f814ff6e8ef75327ac0">Float::operator|</a>(<span class="keyword">const</span> <a class="code" href="class_float.html">Float</a>&amp; rhs)<span class="keyword"> const</span>{</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <a class="code" href="class_float.html">Float</a> res(*<span class="keyword">this</span>);</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;   res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> | rhs.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;   res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> | rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;   <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;}</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="class_float.html#a22e26a8b674166538fdaff990ac54d0c">  152</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_float.html">Float</a> <a class="code" href="class_float.html#a22e26a8b674166538fdaff990ac54d0c">Float::operator^</a>(<span class="keyword">const</span> <a class="code" href="class_float.html">Float</a>&amp; rhs)<span class="keyword"> const</span>{</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <a class="code" href="class_float.html">Float</a> res(*<span class="keyword">this</span>);</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;   res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> ^ rhs.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;   res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> ^ rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;   <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;}</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="keyword">inline</span> <a class="code" href="class_float.html">Float</a> <a class="code" href="class_float.html#a829c0b43e7a23d1cbeda0ffc61b83458">Float::operator&amp;</a>(<span class="keyword">const</span> <a class="code" href="class_float.html">Float</a>&amp; rhs)<span class="keyword"> const</span>{</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    <a class="code" href="class_float.html">Float</a> res(*<span class="keyword">this</span>);</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;   res.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> = <a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a> &amp; rhs.<a class="code" href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">expnt</a>;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;   res.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> = <a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a> &amp; rhs.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>;</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;   <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;}</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="class_float.html#a70160ad3e24bbd8355b97f5243164f8c">  166</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_bit.html">Bit</a> <a class="code" href="class_float.html#a70160ad3e24bbd8355b97f5243164f8c">Float::greater</a>(<span class="keyword">const</span> <a class="code" href="class_float.html">Float</a>&amp; rhs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;   <a class="code" href="class_float.html">Float</a> tmp = (*this) - rhs;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;   <span class="keywordflow">return</span> !tmp.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>[tmp.<a class="code" href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">value</a>.<a class="code" href="class_integer.html#af2ab5650c234f514ee6b223a50178737">size</a>()-1];</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;}</div><div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="class_float.html#aa58d231c7416f0a132d32cfab7ef1499">  170</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="class_bit.html">Bit</a> <a class="code" href="class_float.html#aa58d231c7416f0a132d32cfab7ef1499">Float::equal</a>(<span class="keyword">const</span> <a class="code" href="class_float.html">Float</a>&amp; rhs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;}</div><div class="ttc" id="class_float_html_a829c0b43e7a23d1cbeda0ffc61b83458"><div class="ttname"><a href="class_float.html#a829c0b43e7a23d1cbeda0ffc61b83458">Float::operator &amp;</a></div><div class="ttdeci">Float operator &amp;(const Float &amp;rhs) const</div></div>
<div class="ttc" id="class_float_html_a960edb0060fc2ca0b4a2aee99b005863"><div class="ttname"><a href="class_float.html#a960edb0060fc2ca0b4a2aee99b005863">Float::operator/</a></div><div class="ttdeci">Float operator/(const Float &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> float.hpp:133</div></div>
<div class="ttc" id="class_float_html_a983db0d2b83de7893840b434c9f52e67"><div class="ttname"><a href="class_float.html#a983db0d2b83de7893840b434c9f52e67">Float::abs</a></div><div class="ttdeci">Float abs() const</div><div class="ttdef"><b>Definition:</b> float.hpp:44</div></div>
<div class="ttc" id="class_float_html_afa32b241f39b9caf3cc574f49b00259e"><div class="ttname"><a href="class_float.html#afa32b241f39b9caf3cc574f49b00259e">Float::operator+</a></div><div class="ttdeci">Float operator+(const Float &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> float.hpp:67</div></div>
<div class="ttc" id="class_float_html_aa58d231c7416f0a132d32cfab7ef1499"><div class="ttname"><a href="class_float.html#aa58d231c7416f0a132d32cfab7ef1499">Float::equal</a></div><div class="ttdeci">Bit equal(const Float &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> float.hpp:170</div></div>
<div class="ttc" id="class_float_html_aa39a93665ab0b36f29553229fd544e8b"><div class="ttname"><a href="class_float.html#aa39a93665ab0b36f29553229fd544e8b">Float::operator-</a></div><div class="ttdeci">Float operator-() const</div><div class="ttdef"><b>Definition:</b> float.hpp:89</div></div>
<div class="ttc" id="class_integer_html_a4f3c2fa68e1a235b05a42b337fcd301f"><div class="ttname"><a href="class_integer.html#a4f3c2fa68e1a235b05a42b337fcd301f">Integer::resize</a></div><div class="ttdeci">Integer &amp; resize(int length, bool signed_extend=true)</div><div class="ttdef"><b>Definition:</b> integer.hpp:215</div></div>
<div class="ttc" id="class_float_html_aefd2dcc4f6de7cff5b947a204f4e65f8"><div class="ttname"><a href="class_float.html#aefd2dcc4f6de7cff5b947a204f4e65f8">Float::If</a></div><div class="ttdeci">Float If(const Bit &amp;select, const Float &amp;d)</div><div class="ttdef"><b>Definition:</b> float.hpp:12</div></div>
<div class="ttc" id="utils_8h_html_ad17d551e31d1828c68acf40684849b7e"><div class="ttname"><a href="utils_8h.html#ad17d551e31d1828c68acf40684849b7e">PUBLIC</a></div><div class="ttdeci">#define PUBLIC</div><div class="ttdef"><b>Definition:</b> utils.h:14</div></div>
<div class="ttc" id="class_float_html_a90588ea3c8ada7be699d5509552d8d8b"><div class="ttname"><a href="class_float.html#a90588ea3c8ada7be699d5509552d8d8b">Float::value</a></div><div class="ttdeci">Integer value</div><div class="ttdef"><b>Definition:</b> float.h:11</div></div>
<div class="ttc" id="class_integer_html_ac6bdcb2c326485873b4797ae3b4aea80"><div class="ttname"><a href="class_integer.html#ac6bdcb2c326485873b4797ae3b4aea80">Integer::abs</a></div><div class="ttdeci">Integer abs() const</div><div class="ttdef"><b>Definition:</b> integer.hpp:208</div></div>
<div class="ttc" id="class_float_html_a22e26a8b674166538fdaff990ac54d0c"><div class="ttname"><a href="class_float.html#a22e26a8b674166538fdaff990ac54d0c">Float::operator^</a></div><div class="ttdeci">Float operator^(const Float &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> float.hpp:152</div></div>
<div class="ttc" id="class_float_html_acf4a690bafac44c1d308ca10fd11b0be"><div class="ttname"><a href="class_float.html#acf4a690bafac44c1d308ca10fd11b0be">Float::detail</a></div><div class="ttdeci">string detail(int party) const</div><div class="ttdef"><b>Definition:</b> float.hpp:33</div></div>
<div class="ttc" id="class_float_html_a1383145c75dd0c9f67a708c7f6df05c3"><div class="ttname"><a href="class_float.html#a1383145c75dd0c9f67a708c7f6df05c3">Float::Float</a></div><div class="ttdeci">Float(Float &amp;&amp;in)</div><div class="ttdef"><b>Definition:</b> float.h:13</div></div>
<div class="ttc" id="class_float_html_ab97c9072b1b955697049e020c238a445"><div class="ttname"><a href="class_float.html#ab97c9072b1b955697049e020c238a445">Float::size</a></div><div class="ttdeci">int size() const</div><div class="ttdef"><b>Definition:</b> float.hpp:40</div></div>
<div class="ttc" id="class_integer_html_af2ab5650c234f514ee6b223a50178737"><div class="ttname"><a href="class_integer.html#af2ab5650c234f514ee6b223a50178737">Integer::size</a></div><div class="ttdeci">int size() const</div><div class="ttdef"><b>Definition:</b> integer.hpp:203</div></div>
<div class="ttc" id="swappable_8h_html_a4043c520b57fcca7b1eaa03102828a0a"><div class="ttname"><a href="swappable_8h.html#a4043c520b57fcca7b1eaa03102828a0a">swap</a></div><div class="ttdeci">void swap(const Bit &amp;swap, T &amp;o1, T &amp;o2)</div><div class="ttdef"><b>Definition:</b> swappable.h:18</div></div>
<div class="ttc" id="class_integer_html"><div class="ttname"><a href="class_integer.html">Integer</a></div><div class="ttdef"><b>Definition:</b> integer.h:14</div></div>
<div class="ttc" id="float_8hpp_html_ac876e387f6e33f7446a0bc1ea7eb3550"><div class="ttname"><a href="float_8hpp.html#ac876e387f6e33f7446a0bc1ea7eb3550">divide_frac</a></div><div class="ttdeci">Integer divide_frac(const Integer &amp;lhs, const Integer &amp;rhs)</div><div class="ttdef"><b>Definition:</b> float.hpp:114</div></div>
<div class="ttc" id="class_float_html_a70160ad3e24bbd8355b97f5243164f8c"><div class="ttname"><a href="class_float.html#a70160ad3e24bbd8355b97f5243164f8c">Float::greater</a></div><div class="ttdeci">Bit greater(const Float &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> float.hpp:166</div></div>
<div class="ttc" id="class_integer_html_a40379b494d4d66d0cbeddc0d72310edc"><div class="ttname"><a href="class_integer.html#a40379b494d4d66d0cbeddc0d72310edc">Integer::leading_zeros</a></div><div class="ttdeci">Integer leading_zeros() const</div><div class="ttdef"><b>Definition:</b> integer.hpp:357</div></div>
<div class="ttc" id="class_float_html_aa879567bee82ec6f3845b93df1791569"><div class="ttname"><a href="class_float.html#aa879567bee82ec6f3845b93df1791569">Float::normalize</a></div><div class="ttdeci">void normalize(int value_length, int to_add_to_expnt)</div><div class="ttdef"><b>Definition:</b> float.hpp:50</div></div>
<div class="ttc" id="class_bit_html"><div class="ttname"><a href="class_bit.html">Bit</a></div><div class="ttdef"><b>Definition:</b> bit.h:8</div></div>
<div class="ttc" id="class_float_html_a93a616ac276fe5e32ec3e983a05e18a4"><div class="ttname"><a href="class_float.html#a93a616ac276fe5e32ec3e983a05e18a4">Float::expnt</a></div><div class="ttdeci">Integer expnt</div><div class="ttdef"><b>Definition:</b> float.h:12</div></div>
<div class="ttc" id="class_float_html_a2828cf2dfd7d5f814ff6e8ef75327ac0"><div class="ttname"><a href="class_float.html#a2828cf2dfd7d5f814ff6e8ef75327ac0">Float::operator|</a></div><div class="ttdeci">Float operator|(const Float &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> float.hpp:145</div></div>
<div class="ttc" id="class_float_html"><div class="ttname"><a href="class_float.html">Float</a></div><div class="ttdef"><b>Definition:</b> float.h:10</div></div>
<div class="ttc" id="class_float_html_ac8a4119a7439bb5035fb702b203f77f2"><div class="ttname"><a href="class_float.html#ac8a4119a7439bb5035fb702b203f77f2">Float::operator*</a></div><div class="ttdeci">Float operator*(const Float &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> float.hpp:95</div></div>
<div class="ttc" id="class_integer_html_a46c3a539863fb2ff610a4d6ef61b9367"><div class="ttname"><a href="class_integer.html#a46c3a539863fb2ff610a4d6ef61b9367">Integer::reveal</a></div><div class="ttdeci">O reveal(int party=PUBLIC) const</div></div>
<div class="ttc" id="input-check-malicious_8cpp_html_aefdd5aa9f02e7cb8d21ea22b0e6b03df"><div class="ttname"><a href="input-check-malicious_8cpp.html#aefdd5aa9f02e7cb8d21ea22b0e6b03df">party</a></div><div class="ttdeci">int party</div><div class="ttdef"><b>Definition:</b> input-check-malicious.cpp:12</div></div>
<div class="ttc" id="class_swappable_html_ac97b7bae2309410714c7416f1de53378"><div class="ttname"><a href="class_swappable.html#ac97b7bae2309410714c7416f1de53378">Swappable::If</a></div><div class="ttdeci">T If(const Bit &amp;sel, const T &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> swappable.h:8</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_eec959d81771dc8b1a750b834e1341eb.html">emp-tool</a></li><li class="navelem"><a class="el" href="dir_2b4671b717884caf3b3fe5ce6896c1bb.html">circuits</a></li><li class="navelem"><a class="el" href="float_8hpp.html">float.hpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li>
  </ul>
</div>
</body>
</html>
